package org.jim.server.demo.listener;

import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import org.jim.core.ImChannelContext;
import org.jim.core.exception.ImException;
import org.jim.core.packets.User;
import org.jim.server.listener.AbstractImUserListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author WChao
 * @Desc
 * @date 2020-05-02 18:18
 */
public class ImDemoUserListener extends AbstractImUserListener {

    private static Logger log = LoggerFactory.getLogger(ImDemoUserListener.class);

    @Override
    public void doAfterBind(ImChannelContext imChannelContext, User user) throws ImException {
        log.info("绑定用户:{}", JSONUtil.toJsonStr(user));
    }

    @Override
    public void doAfterUnbind(ImChannelContext imChannelContext, User user) throws ImException {
        log.info("解绑用户:{}",JSONUtil.toJsonStr(user));
    }
}
